package root.electronclass.electronclass.other.dialog

import android.content.Intent
import android.os.Bundle
import android.provider.Settings
import android.view.View
import android.widget.Toast
import com.blankj.utilcode.util.StringUtils
import root.electronclass.electronclass.common.base.CommonDialogFragment
import root.electronclass.electronclass.databinding.SetDialogBinding

/**
 *@ClassName TODO
 *@Description TODO
 *@Author caofc
 *@Date 2023/4/16 14:25
 */
class SetDialog : CommonDialogFragment<SetDialogBinding>() {
    var onSubClick: (String) -> Unit = {}
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

        onOkClick = click@{
            val pwd = binding.edit.text.toString().trim { it <= ' ' }
            if (StringUtils.isEmpty(pwd)) {

            } else {
                onSubClick.invoke(pwd)
                dismissAllowingStateLoss()
            }
        }

        onCancelClick = {
            dismiss()
        }
    }

}

